package com.joy.model;

import lombok.*;

import java.sql.Timestamp;

@Data
public class User {
    private Long id; // 使用Long类型以匹配bigint
    private String userCode; //学生编号
    private String userName; // 根据字段名的约定，变量名使用驼峰命名法
    private String password; // 已加密的密码
    private String salt; // 加密盐
    private String school; // 学校
    private String faculty; // 院系
    private String type; // 用户类型：1-老师 2-学生 3-管理员
    private Integer status; // 用户状态
    private Timestamp createTime; // 最后修改时间
    private Timestamp modifyTime; // 创建时间
    private String gender;//性别 1-男生 2-女生
    private String phone;//手机号

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getFaculty() {
        return faculty;
    }

    public void setFaculty(String faculty) {
        this.faculty = faculty;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Timestamp modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public User() {

    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userCode='" + userCode + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", salt='" + salt + '\'' +
                ", school='" + school + '\'' +
                ", faculty='" + faculty + '\'' +
                ", type='" + type + '\'' +
                ", status=" + status +
                ", createTime=" + createTime +
                ", modifyTime=" + modifyTime +
                ", gender='" + gender + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }

    public User(Long id, String userCode, String userName, String password, String salt, String school, String faculty, String type, Integer status, Timestamp createTime, Timestamp modifyTime, String gender, String phone) {
        this.id = id;
        this.userCode = userCode;
        this.userName = userName;
        this.password = password;
        this.salt = salt;
        this.school = school;
        this.faculty = faculty;
        this.type = type;
        this.status = status;
        this.createTime = createTime;
        this.modifyTime = modifyTime;
        this.gender = gender;
        this.phone = phone;
    }

}